package com.study.design.pattern.pattern.creational.simplefactory;

/**
 * @Author: gongsl
 * @Date: 2025-01-14 22:01
 * @description:
 */
public class VideoFactory {
    public static <T extends Video> Video getVideo(Class<T> type) {
        try {
            return (Video) Class.forName(type.getName()).newInstance();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
